<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>


<%@page import="org.springframework.web.context.request.SessionScope"%>
<script type="text/javascript">
	/**
	* Set the Radio-Buttons Invisble
	*/
	function invisbleRadio() {
		// do nothing
	}

	/**
	 * Deactivates the show, edit and delete button.
	 */
	function deactivateButtons() {
		// do nothing
	}
</script>

<!-- <%-- onsubmit="return validateDepartmentForm(this);" --%> -->

<html:form action="/adCreateEditDepartment" method="post" enctype="multipart/form-data">
	<table>
			<tr>
				<td><b><bean:message key="label.zipcode" />:</b></td>
				<td><html:text property="department.zipcode" /> <span class="validateError"><html:errors property="department.zipcode" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.city" />:</b></td>
				<td><html:text property="department.city" /> <span class="validateError"><html:errors property="department.city" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.street" />:</b></td>
				<td><html:text property="department.street" /> <span class="validateError"><html:errors property="department.street" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.houseNumber" />:</b></td>
				<td><html:text property="department.houseNumber" /> <span class="validateError"><html:errors property="department.houseNumber" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.chief" />:</b></td>
				<td><html:text property="department.chief" /> <span class="validateError"><html:errors property="department.chief" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.cochief" />:</b></td>
				<td><html:text property="department.coChief" /> <span class="validateError"><html:errors property="department.coChief" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.telephone" />:</b></td>
				<td><html:text property="department.telephoneNumber" /> <span class="validateError"><html:errors property="department.telephoneNumber" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.telefax" />:</b></td>
				<td><html:text property="department.telefaxNumber" /></td>
			</tr><tr>
				<td><b><bean:message key="label.eMail" />:</b></td>
				<td><html:text property="department.eMail" /> <span class="validateError"><html:errors property="department.eMail" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.homepageURL" />:</b></td>
				<td><html:text property="department.homepageURL" /> <span class="validateError"><html:errors property="department.homepageURL" /></span></td>
			</tr><tr>
				<td><b><bean:message key="label.members" />:</b></td>
				<td><html:text property="department.members" /></td>
			</tr><tr>
				<td><b><bean:message key="label.descriptionText" />:</b></td>
				<td><html:textarea property="department.descriptionText" /></td>
			</tr><tr>
				<td><b><bean:message key="label.image" />:</b></td>
				<td><html:file property="aDepartmentImageFile" /></td>
			</tr><tr>
				<td><b><bean:message key="label.linkCarsToDept" />:</b></td>
				<td>
					<html:select property="selectedCarIds" multiple="true" size="10" >
						<html:option value=""></html:option>
						<c:forEach var="car" items="${sessionScope.departmentForm.cars}"
							varStatus="rowStatus">
							<html:option value="${car.carId}">${car.modelName}</html:option>
						</c:forEach>
					</html:select>
				</td>
				
				</tr><tr>
				<td>
					<b><bean:message key="label.linkedCars" />:</b>
				</td><td>
					<c:forEach var="carName" items="${sessionScope.departmentForm.selectedCarNames}"
						varStatus="rowStatus">
						${carName}<br />
					</c:forEach>
				</td>
			</tr>
	</table>
	<html:submit>
		<bean:message key="button.save" />
	</html:submit>
	<html:button property="method" onclick="history.back();">
		<bean:message key="button.back" />
	</html:button>
</html:form>
<%-- <html:javascript formName="departmentForm" /> --%>